﻿using FairyGUI;

/// <summary>
/// 充值
/// </summary>
public class UIHome_Charge : UIPopupWindow {

    public UIHome_Charge()
    {
        // 加载界面
        base.Init(UIPackage.CreateObject("主界面", "充值说明").asCom);

        // 初始化关闭按钮
        GButton closeBtn = uiComp.GetChild("关闭按钮").asButton;
        closeBtn.onClick.Add(() => {
            _Close();
        });

        // 初始化知道了按钮
        GButton okBtn = uiComp.GetChild("知道了按钮").asButton;
        okBtn.onClick.Add(() => {
            _Close();
        });
    }

    void _Close()
    {
        DebugInfo.Log("关闭充值说明");

        AudioController.inst.PlayUIClickEffect();
        uiComp.RemoveFromParent();
        uiComp.Dispose();
        base.Close();
    }

    /// <summary>
    /// 弹出窗口
    /// </summary>
    public static void Popup()
    {
        DebugInfo.Log("打开充值说明");
        UIRootController.inst.PopupWindow(new UIHome_Charge());
    }
}
